package com.codedancer.campus.client.api.plate;

import com.codedancer.campus.client.service.IPlateService;
import com.codedancer.campus.client.service.vo.plate.PlateVo;
import com.codedancer.campus.common.anno.PassToken;
import com.codedancer.campus.common.core.BaseApi;
import com.codedancer.campus.common.response.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/plate")
@CrossOrigin(methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE,
    RequestMethod.PUT}, maxAge = 3600)
@Api(value = "板块Api", description = "板块Api", tags = "板块Api")
public class PlateApi extends BaseApi {

    @Autowired
    private IPlateService plateService;

    @GetMapping("/all")
    @ApiOperation("获取所有板块")
    @PassToken
    public ApiResponse<List<PlateVo>> all(){
        return success(plateService.all());
    }
}
